<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="tfn" uri="http://www.totoro.com/functions" %>
<html>
<head>
    <title>天猫 - 我的购物车</title>
    <link rel="shortcut icon" type="image/x-icon" href="/static/img/index/favicon.png">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/public.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/nav.css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/iconFont/iconfont.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/buy/cart.css"/>
    <style>
        .layui-form-checkbox[lay-skin=primary] {
            height: auto !important;
            line-height: normal !important;
            min-width: 12px;
            min-height: 14px;
            border: none !important;
            margin-right: 0;
            padding-left: 28px;
            padding-right: 0;
            background: 0 0;
        }

        .layui-form-checkbox[lay-skin=primary] i {
            right: auto;
            left: 0;
            width: 12px;
            height: 12px;
            line-height: 12px;
            border: 1px solid #d2d2d2;
            font-size: 12px;
            border-radius: 2px;
            background-color: #fff;
            -webkit-transition: .1s linear;
            transition: all .3s ease 0s;
        }
    </style>
</head>
<body>
<jsp:include page="/public_page/nav.jsp"></jsp:include>
<div style="width: 100%; left: 0px; top: 0px; height: 100%; position: fixed; user-select: none; display:none; z-index: 999998;" class="ks-dialog-mask ks-overlay-mask"></div>
<script src="${pageContext.request.contextPath}/static/js/frame/jquery-3.5.1.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/frame/totoro-utils.js"></script>
<script src="//unpkg.com/layui@2.6.8/dist/layui.js"></script>

<div id="content">
    <div id="J_Header" class="header tb-header">
        <h1 id="logo" class="cart-logo">
            <a href="/" title="totoro天猫 ttmall.com - 龙猫旗下网站" target="_top"><span
                    style=" background: url(//img.alicdn.com/tfs/TB11ojWRXXXXXafaFXXXXXXXXXX-190-27.png) no-repeat;"></span></a>
        </h1>
        <div class="header-extra">
            <div id="mallSearch" class="mall-search">
                <form name="searchTop" action="/search_product.htm" class="mallSearch-form"
                      accept-charset="gbk">
                    <fieldset>
                        <legend>天猫搜索</legend>
                        <div class="mallSearch-input clearfix">
                            <div class="defaultSearch">
                                <div id="s-combobox-913" class="s-combobox">
                                    <div class="s-combobox-input-wrap">
                                        <input type="text" name="enter" accesskey="enter" autocomplete="off" x-webkit-speech="" x-webkit-grammar="builtin:translate" value="" id="mq" class="s-combobox-input" role="combobox" aria-haspopup="true" title="请输入搜索文字" aria-label="请输入搜索文字"></div>
                                    <label for="mq" class="s-combobox-placeholder" style="color: rgb(102, 102, 102); visibility: visible;">搜索 天猫 商品/品牌/店铺</label>
                                </div>
                                <button id="J_SearchBtn" type="submit">
                                    搜天猫
                                    <s></s>
                                </button>
                            </div>
<%--                            <button id="J_CurrShopBtn" class="currShopBtn" type="button">搜本店<s></s></button>--%>
                        </div>
                    </fieldset>
                </form>
            </div>
        </div>
    </div>

    <div class="cart-layout-TB ">
        <!--banner-->
        <div id="J_Cart" class="cart">
            <div id="J_FilterBar" class="cart-filter-bar">
                <ul id="J_CartSwitch" class="switch-cart">
                    <li class="btn-switch-cart switch-cart-0 ${empty param.findType?'current':''}">
                        <a href="?not" class="J_MakePoint" data-point="tbcart.8.35">
                            <em>全部商品</em>
                            <span class="number">${allProductLength}</span>
                            <span class="pipe">
                            </span>
                        </a>
                    </li>
                    <li class="btn-switch-cart switch-cart-2 ${param.findType == 2?'current':''}">
                        <a href="${priceReductionProductLength == 0?'javascript:viod(0)':'?findType=2'}" class="J_MakePoint" ${priceReductionProductLength == 0?'style="cursor: not-allowed;"':''}>
                            <em>降价商品</em>
                            <span class="number" style="color:#000;">${priceReductionProductLength}</span>
                            <span class="pipe"></span>
                        </a>
                    </li>
                    <li class="btn-switch-cart switch-cart-4 ${param.findType == 3?'current':''}">
                        <a href="${stockAlarmProductLength == 0?'javascript:viod(0)':'?findType=3'}" class="J_MakePoint" ${stockAlarmProductLength == 0?'style="cursor: not-allowed;"':''}>
                            <em>库存紧张</em>
                            <span class="number">${stockAlarmProductLength}</span>
                            <span class="pipe"></span>
                        </a>
                    </li>
                </ul>
                <div class="cart-sum"><span class="pay-text">已选商品（不含运费）</span>
                    <strong class="price">
                        <em id="J_SmallTotal">
                            <span class="total-symbol">&nbsp;
                            </span>0.00
                        </em>
                    </strong>
                    <a id="J_SmallSubmit" class="submit-btn submit-btn-disabled">结&nbsp;算</a>
                </div>
                <div class="wrap-line">
                    <div class="floater" style="width: 123px; left: -1px;"></div>
                </div>
            </div>
            <div id="J_CartMain" class="cart-main">
                <div class="cart-table-th">
                    <div class="wp">
                        <div class="th th-chk">
                            <div id="J_SelectAll1" class="select-all J_SelectAll">
                                <div class="cart-checkbox layui-form">
                                    <input type="checkbox" name="c" lay-skin="primary" lay-filter="all-ck"/>
                                </div>&nbsp;&nbsp;全选
                            </div>
                        </div>
                        <div class="th th-item">
                            <div class="td-inner" data-spm-anchor-id="a1z0d.6639537.0.i0.59d77484772xCR">商品信息</div>
                        </div>
                        <div class="th th-info">
                            <div class="td-inner">&nbsp;</div>
                        </div>
                        <div class="th th-price">
                            <div class="td-inner">单价</div>
                        </div>
                        <div class="th th-amount">
                            <div class="td-inner">数量</div>
                        </div>
                        <div class="th th-sum">
                            <div class="td-inner">金额</div>
                        </div>
                        <div class="th th-op">
                            <div class="td-inner">操作</div>
                        </div>
                    </div>
                </div>
                <!-- 店铺 商品 -->
                <div id="J_OrderList" data-spm="1997196601" data-spm-max-idx="50">
                    <c:if test="${fn:length(carts) == 0}">
                        <p>暂无记录，快去添加几个你喜欢的宝贝到购物车吧！</p>
                    </c:if>
                    <%-- 第一层循环：购物车， 第二层循环：店铺， 第三层：商品 --%>
                    <c:forEach items="${carts}" var="cart" varStatus="csVs">

                        <c:forEach items="${cart.shops}" var="shop" varStatus="ssVs">


                            <div id="J_OrderHolder_s_1790973264_1" style="height: auto;" class="J_OrderHolder">
                                <div id="J_Order_s_1790973264_1" class="J_Order clearfix order-body" data-sid="${shop.id}">
                                    <div class="J_ItemHead shop clearfix">
                                        <div class="shop-info">
                                            <div class="cart-checkbox layui-form">
                                                <input type="checkbox" name="c" lay-skin="primary" lay-filter="shop-ck"/>
                                            </div>
                                            &nbsp;&nbsp;<span class="shop-icon icon-B"></span>店铺：
                                            <a href="" target="_blank" title="${shop.shopName}" class="J_MakePoint"
                                               data-point="tbcart.8.15">${shop.shopName}</a><span class="ww-light ww-small"
                                                                                       data-items="s_1790973264_1" data-icon="small" data-nick="蒙牛旗舰店"
                                                                                       data-display="inline">
                                            <a
                                                target="_blank" class="ww-inline ww-online" data-to-uid="${shop.slid}"
                                                title="点此可以直接和卖家交流选好的宝贝，或相互交流网购体验，还支持语音视频噢。"></a></span>
                                            <span>123</span>
                                        </div>
                                    </div>


                                    <c:forEach items="${shop.products}" var="product" varStatus="psVs">
                                    <div class="order-content ${product.isLanunched == 0 or product.isDelete == 1 or product.productSpecs.productStock == 0?'order-fail':''}" data-pid="${product.id}" data-spm-ctid="${product.cartId}">
                                        <div id="J_BundleList_s_2022561587_1" class="item-list">
                                            <div id="J_Bundle_s_2022561587_1_0" class="bundle">

                                                <div id="J_ItemHolder_2985926168778" class="item-holder">
                                                    <div id="J_Item_2985926168778"
                                                         class="J_ItemBody item-body clearfix item-normal first-item last-item">
                                                        <ul class="item-content clearfix">
                                                            <li class="td td-chk">
                                                                <div class="td-inner">
                                                                    <div style="height: 82px;position: relative;">
                                                                        <!-- 失效 -->
                                                                        <c:if test="${product.isDelete == 1 or product.isLanunched == 0 or product.productSpecs.productStock == 0}" var="isFail">
                                                                            <a class="item-label label-invalid" title="商品被下架、删除、库存不足，或商家处于被监管或冻结状态" target="_blank" href="//service.taobao.com/support/knowledge-1116245.htm">失效</a>
                                                                        </c:if>
                                                                        <c:if test="${!isFail}">
                                                                        <div class="cart-checkbox layui-form">
                                                                            <input type="checkbox" name="c" lay-skin="primary" lay-filter="product-ck"/>
                                                                        </div>
                                                                        </c:if>
                                                                    </div>
                                                                </div>
                                                            </li>
                                                            <li class="td td-item">
                                                                <div class="td-inner">
                                                                    <div class="item-pic J_ItemPic img-loaded"><a
                                                                            href="/buy.htm?pid=${product.id}&skuCode=${product.productSpecs.id}"
                                                                            target="_blank"
                                                                            data-title="${product.productName}"
                                                                            class="J_MakePoint J_GoldReport"
                                                                            data-point="tbcart.8.12">
                                                                        <img src="${product.productImages[0].imagePath}"
                                                                            class="itempic J_ItemImg"></a></div>
                                                                    <div class="item-info">
                                                                        <div class="item-basic-info"> <a
                                                                                href="/buy.htm?pid=${product.id}&skuCode=${product.productSpecs.id}"
                                                                                target="_blank"
                                                                                title="${product.productName}"
                                                                                class="item-title J_GoldReport J_MakePoint"
                                                                                data-point="tbcart.8.11">${product.productName}</a>
                                                                        </div>
                                                                        <div class="item-other-info">
                                                                            <div class="promo-logos"></div>
                                                                            <div class="item-icon-list clearfix">
                                                                                <div
                                                                                        class="item-icons J_ItemIcons  item-icons-fixed ">
																					<span class="item-icon item-icon-0"
                                                                                          title="支持信用卡支付"><img
                                                                                            src="//assets.alicdn.com/sys/common/icon/trade/xcard.png"
                                                                                            alt=""></span><a
                                                                                        href="//pages.tmall.com/wow/seller/act/seven-day"
                                                                                        target="_blank"
                                                                                        class="item-icon item-icon-1 J_MakePoint"
                                                                                        data-point="tbcart.8.26"
                                                                                        title="消费者保障服务，卖家承诺7天退换"><img
                                                                                        src="//img.alicdn.com/tps/i3/T1Vyl6FCBlXXaSQP_X-16-16.png"
                                                                                        alt=""></a><a
                                                                                        href="//www.taobao.com/go/act/315/xfzbz_rsms.php?ad_id=&amp;am_id=130011830696bce9eda3&amp;cm_id=&amp;pm_id="
                                                                                        target="_blank"
                                                                                        class="item-icon item-icon-2 J_MakePoint"
                                                                                        data-point="tbcart.8.26"
                                                                                        title="消费者保障服务，卖家承诺如实描述"><img
                                                                                        src="//img.alicdn.com/tps/i4/T1BCidFrNlXXaSQP_X-16-16.png"
                                                                                        alt=""></a>
                                                                                </div>
                                                                            </div>
                                                                            <div class="item-tips"></div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </li>
                                                            <%-- sku展示 --%>
                                                            <li class="td td-info" data-skuid="${product.skuCode}" data-spm-sk="${product.productSpecs.productStock}">
                                                                <c:set var="skuData" value="${product.productSpecs.productSpaceData}"></c:set>
                                                                <c:set var="skuDatas" value='${fn:split(fn:replace(fn:replace(skuData, "{" , ""), "}", ""), ",")}'></c:set>
                                                                <div class="${!isFail?'item-props':'not-us'} item-props-can">
                                                                    <c:forEach begin="0" end="${fn:length(skuDatas)-1}" varStatus="hdVs">
                                                                        <p class="sku-line">${fn:split(fn:replace(skuDatas[hdVs.index], "\"", ""), "|")[0]}</p>
                                                                    </c:forEach>
                                                                    <c:if test="${!isFail}">
                                                                        <span tabindex="0" class="btn-edit-sku J_BtnEditSKU J_MakePoint">修改</span>
                                                                    </c:if>
                                                                </div>
                                                            </li>
                                                            <li class="td td-price">
                                                                <div class="td-inner">
                                                                    <div class="item-price price-promo-">
                                                                        <div class="price-content">
                                                                            <div class="price-line"><em
                                                                                    class="price-original">￥${product.productSpecs.productPrice}</em>
                                                                            </div>
                                                                            <div class="price-line"><em
                                                                                    class="J_Price price-now"
                                                                                    tabindex="0" data-spm-pe="${product.productSpecs.productPrice}">￥${product.productSpecs.productPrice}</em></div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </li>
                                                            <li class="td td-amount">
                                                                <div class="td-inner">
                                                                    <div class="amount-wrapper ">
                                                                        <div class="item-amount ">
                                                                            <c:if test="${product.isDelete == 1 or product.isLanunched == 0 or product.productSpecs.productStock == 0}" var="isFail">
                                                                                <p style="color: #ccc">${product.productCount}</p>
                                                                            </c:if>
                                                                            <c:if test="${!isFail}">
                                                                                <a class='J_Minus minus ${product.productCount ==1?"no-minus":""}'>-</a>
                                                                                <input
                                                                                        type="text" value="${product.productCount}"
                                                                                        class="text text-amount J_ItemAmount"
                                                                                        data-max="560" data-now="1"
                                                                                        autocomplete="off">
                                                                                <a class='J_Plus plus ${product.productCount == product.productSpecs.productStock?"no-plus":""}'>+</a>
                                                                            </c:if>
                                                                        </div>
                                                                        <div class="amount-msg J_AmountMsg"></div>
                                                                    </div>
                                                                </div>
                                                            </li>
                                                            <li class="td td-sum">
                                                                <div class="td-inner"><em tabindex="0"
                                                                                          class="J_ItemSum number">￥${product.productSpecs.productPrice * product.productCount}</em>
                                                                    <div class="J_ItemLottery"></div>
                                                                </div>
                                                            </li>
                                                            <li class="td td-op">
                                                                <div class="td-inner">
                                                                    <a title="移入收藏夹" style="color: black"
                                                                       class="btn-fav J_Fav J_MakePoint move-collect">移入收藏夹</a>
                                                                    <a href="javascript:;" class="J_Del J_MakePoint" style="color: black">删除</a>
                                                                    <div class="find-similar J_find_similar close"
                                                                         data-sellerid="2022561587"
                                                                         data-itemid="641777655399"
                                                                         data-categoryid="3035">
                                                                        <div class="J_find_similar_trigger"><span
                                                                                class="arrow"></span><i
                                                                                class="icon-bd-title"></i></div>
                                                                        <div class="find-similar-body"><img
                                                                                src="//gtd.alicdn.com/tps/i2/T1Q2BUXaxFXXXXXXXX-32-32.gif"
                                                                                class="find-similar-loading"></div>
                                                                    </div>
                                                                </div>
                                                            </li>
                                                        </ul>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    </c:forEach>


                                </div>
                            </div>


                        </c:forEach>


                    </c:forEach>
                </div>
            </div>
            <div id="J_FloatBarHolder" class="float-bar-holder">
                <div id="J_FloatBar" class="float-bar clearfix default" style="position: static;">
                    <div id="J_SelectedItems" class="group-wrapper group-popup hidden" style="display: none;">
                        <div id="J_SelectedItemsList" class="group-content"></div><span class="arrow"></span>
                    </div>
                    <div class="float-bar-wrapper">
                        <div id="J_SelectAll2" class="select-all J_SelectAll">
                            <div class="cart-checkbox layui-form">
                                <input type="checkbox" name="c" lay-skin="primary" lay-filter="all-ck"/>
                            </div>全选
                        </div>
                        <div class="operations"><a href="#" hidefocus="true" class="J_DeleteSelected">删除</a><a
                                href="#" hidefocus="true" class="J_ClearInvalid hidden">清除失效宝贝</a>
                            <a hidefocus="true" class="J_BatchFav">移入收藏夹</a></div>
                        <div class="float-bar-right">
                            <div id="J_ShowSelectedItems" class="amount-sum"><span class="txt">已选商品</span><em
                                    id="J_SelectedItemsCount">0</em><span class="txt">件</span>
                                <div class="arrow-box"><span class="selected-items-arrow"></span><span
                                        class="arrow"></span></div>
                            </div>
                            <div id="J_CheckCOD" class="check-cod" style="display: none;"><span
                                    class="icon-cod"></span><span class="s-checkbox J_CheckCOD"></span>货到付款
                            </div>
                            <div class="pipe"style="float: left;margin: 0 10px 0 18px;width: 1px;height: 12px;"></div>
                            <div class="price-sum"><span class="txt">合计（不含运费）：</span><strong class="price" style="color: #f40;font-weight: 400;font-size: 18px;line-height: 48px;font-family: Arial;"><em
                                    id="J_Total" style="font-weight: 700; font-size: 22px; padding: 0 3px;"><span class="total-symbol">&nbsp;</span>0.00</em></strong>
                            </div>
                            <div class="btn-area"><a href="javascript:void(0)" id="J_Go"
                                                     class="submit-btn submit-btn-disabled"
                                                     aria-label="请注意如果没有选择宝贝，将无法结算"><span>结&nbsp;算</span><b></b></a></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <input id="_tb_token_" type="hidden" value="3f53be3fa3865" name="_tb_token_">
        <input type="hidden" id="isMemberCart" value="">
        <input type="hidden" id="J_BuyerLevel" value="oldBuyer">
    </div>
</div>
<div id="fav-lay-prefix-2294598278601" class="fav-box" style="top: 3375.22px; left: 1414.5px; display: none">
    <div class="msg fav-status"><p class="ok">成功移至收藏夹！</p>
    </div>
</div>
<jsp:include page="/public_page/last.html"></jsp:include>
<jsp:include page="/public_page/open_chat.jsp"></jsp:include>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/self/buy/cart.js"></script>
</body>
</html>
